using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DataPopulation
{
    public partial class ResultsDlg : Form
    {
        private int maxlines = 200;

        public ResultsDlg()
        {
            InitializeComponent();
        }

        public void AddMsg(string msg)
        {
            lbResults.Items.Insert(0, DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString() + " " + msg);
            if (lbResults.Items.Count > maxlines) lbResults.Items.RemoveAt(lbResults.Items.Count - 1);
        }

        public void Clear()
        {
            lbResults.Items.Clear();
        }

        private void ResultsDlg_Load(object sender, EventArgs e)
        {
            lbResults.Items.Clear();
        }

        private void btnHide_Click(object sender, EventArgs e)
        {
            Hide();
        }
    }
}